/*
* @Author: Yejing
* @Date: 2023-06-10 10:31:19
* @LastEditors: Yejing
* @LastEditTime: 2023-06-10 10:31:19
* @Description: desc
*/
<template>
	<view class="modify-page">
		<!-- 头部 -->
		<c-layout>
			<c-navigation-bar title="Certificate" :bottomBorder='false' backIconColor='#fff'
				:navPlaceholder='search.navPlaceholder' :navThmen='search.navThmen' @focusEvent='focusEvent'
				@switchSvgEvent='switchSvgEvent'>
			</c-navigation-bar>

			<certificateContract :title="$t('Contract.title')" sort="123" :num="shopId" :where="user.nickName"
				:name="user.nickName" :sign="sign" :time="time" :bianhao="123456789123456789"></certificateContract>

			<view class="bootom">
				<u-button @click="Determine" type="primary">
					{{$t('storeManagement.Completed')}}
				</u-button>
			</view>
		</c-layout>



	</view>
</template>

<script>
	import certificateContract from '@/components/CertificateContract/CertificateContract.vue'
	export default {
		components: {
			certificateContract,
		},
		data() {
			return {
				//搜索
				search: {
					navThmen: 'line',
					navPlaceholder: 'Donate for',
					navType: 'navBackTitle',
				},

				shopId: '',
				time: new Date(),
				sign:'',
				user: {}
			}
		},
		onLoad() {
			this.user = this.$store.state.vuex_user_info
			console.log(this.$store.state)
			this.$u.get('/app/shop').then(res => {
				const moment = require('moment');

				this.shopId = res.data.id
				// new Date(res.data.createTime).toLocaleDateString('en-US')

				this.time = moment(new Date()).format('DD-MM-YYYY')
				this.$u.get('/app/shop/shopContract/' + this.shopId).then(r => {
					this.content = r.data.shopContract
					this.sign = r.data.sign
					console.log(this.time)
			
				})

			})
		},
		methods: {


			// 签订合同
			Determine() {
				uni.navigateTo({
					url: "/pages/storyType/storeDeposit"
				})
					
			}


		},
		// 必须要在onReady生命周期，因为onLoad生命周期组件可能尚未创建完毕
		onReady() {

			this.$u.get('/app/shop').then(res => {
				this.shopId = res.data.id
			})



		}
	}
</script>

<style lang="scss" scoped>
	.modify-page {
		height: 100vh;

		.container-box {
			height: 80vh;
			overflow: auto;
			padding: 30rpx;

			.contractBox {
				height: 75%;
				background: #fff;
				overflow: auto;
				border-top-left-radius: 20rpx;
				border-top-right-radius: 20rpx;

			}

		}

		.contractBoxPaging {
			border-bottom-right-radius: 20rpx;
			border-bottom-left-radius: 20rpx;
			background: #fff;
			height: 80rpx;
			margin-bottom: 10rpx;
			position: relative;

			.paging {
				width: 80rpx;
				height: 21px;
				text-align: center;
				background: #E8E8E9;
				border-radius: 11px 11px 11px 11px;
				color: #000;
				position: absolute;
				right: 40rpx;
				top: 18rpx;
				font-size: 12px;
				line-height: 21px;
			}
		}

		.bootom {
			position: absolute;
			bottom: 60rpx;
			width: 90%;
			left: 50%;
			transform: translateX(-50%);

			.u-btn {
				padding: 30rpx;
			}
		}

		.p-b-6 {
			padding-bottom: 60rpx;
			width: 100%;
			margin-top: 48rpx;
			display: inline-block;
		}

		.uploaddiv {
			display: flex;
			align-items: center;
			justify-content: center;
			border-radius: 30rpx;
			border-radius: 20rpx;
			opacity: 1;
			border: 1px solid #E8E6EA;
			height: 296rpx;
		}
	}

	/deep/ .sign-img {
		height: 220rpx;
	}
</style>